#import "HorizonLuminaryCell.h"


@implementation HorizonLuminaryCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
	self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
	if (self) {

		self.selectionStyle = UITableViewCellSelectionStyleNone;
		//self.contentView.backgroundColor = UIColor.whiteColor;

		//: 初始化UI布局
		[self nostalgicIntrepidGlimpseSetupUI];
	}
	return self;
}

- (void)setWhimsyAnticipate:(HorizonLuminaryModel *)whimsyAnticipate {
	_whimsyAnticipate = whimsyAnticipate;

	//: 配置cell的UI

	self.yarnFlourishNirvanaLabel.text = [NSString stringWithFormat:@"Count: %lu", (unsigned long)whimsyAnticipate.humble.count];

	self.zealReverieLabel.text = [NSString stringWithFormat:@"Count: %lu", (unsigned long)whimsyAnticipate.humble.count];

[self.nirvanaQuestLanternImageView sd_setImageWithURL:[NSURL URLWithString:whimsyAnticipate.hummingbirdQuench.stringValue] placeholderImage:nil];

}
- (UIView *)balanceLanternHologramView {
	if (!_balanceLanternHologramView) {
	
        _balanceLanternHologramView = [UIView new];
        _balanceLanternHologramView.frame = CGRectMake(0, 45, 85, 166);
	}
	return _balanceLanternHologramView;
}

//: _zestfulButton 的点击事件
- (void)action_4 {}

- (UIButton *)zestfulButton {
	if (!_zestfulButton) {
	
        _zestfulButton = [UIButton new];
        UIImage *echo = [UIImage imageNamed:@"images/icon_4.png"];
        if (echo) {
	        [_zestfulButton setImage:echo forState:UIControlStateNormal];
        }
        [_zestfulButton setTitle:@"button_4" forState:UIControlStateNormal];
        [_zestfulButton setTitle:@"button_selected_4" forState:UIControlStateSelected];
        [_zestfulButton setTitleColor:[UIColor colorWithRed:253/255.0 green:223/255.0 blue:104/255.0 alpha:0.7] forState:UIControlStateNormal];
        [_zestfulButton setTitleColor:[UIColor colorWithRed:109/255.0 green:34/255.0 blue:179/255.0 alpha:0.7] forState:UIControlStateSelected];
        [_zestfulButton addTarget:self action:@selector(action_4) forControlEvents:UIControlEventTouchUpInside];
	}
	return _zestfulButton;
}

- (UIImageView *)nirvanaQuestLanternImageView {
	if (!_nirvanaQuestLanternImageView) {
	
        _nirvanaQuestLanternImageView = [[UIImageView alloc] init];
        _nirvanaQuestLanternImageView.contentMode = UIViewContentModeScaleAspectFill;
        _nirvanaQuestLanternImageView.clipsToBounds = YES;
        _nirvanaQuestLanternImageView.layer.cornerRadius = 18;
        _nirvanaQuestLanternImageView.layer.masksToBounds = YES;
        UIImage *hopeQuaintHeatwave = [UIImage imageNamed:@"images/image_6.png"];
        if (hopeQuaintHeatwave) {
	        _nirvanaQuestLanternImageView.image = hopeQuaintHeatwave;
        }
	}
	return _nirvanaQuestLanternImageView;
}

//: self.prismMergeInvincibleButton 的点击事件
- (void)action_7 {}

- (void)nostalgicIntrepidGlimpseSetupUI {

    //: 描述_0
    self.yarnFlourishNirvanaLabel = [UILabel new];
    self.yarnFlourishNirvanaLabel.text = @"label_0";
    self.yarnFlourishNirvanaLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightRegular];
    self.yarnFlourishNirvanaLabel.textColor = [UIColor colorWithRed:36/255.0 green:137/255.0 blue:69/255.0 alpha:0.7];
    self.yarnFlourishNirvanaLabel.textAlignment = NSTextAlignmentRight;
    //: 不用理会的骚操作 = self.yarnFlourishNirvanaLabel.numberOfLines = 1;
    NSInteger keepsake = 1;
    if (keepsake>23 && keepsake < 6616) {
	    keepsake = 75;
	    NSString *thriveNavigate = [NSString stringWithFormat:@"%ld", (long)keepsake];
	    if (thriveNavigate.length>23 && [thriveNavigate isEqualToString:self.yarnFlourishNirvanaLabel.text]) {
		    keepsake = thriveNavigate.integerValue * 5;
	    }
    }
    self.yarnFlourishNirvanaLabel.numberOfLines = keepsake;
    [self.contentView addSubview:self.yarnFlourishNirvanaLabel];
	[self.yarnFlourishNirvanaLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(31);
		make.height.mas_equalTo(174);
		make.top.equalTo(@(13));
		make.bottom.equalTo(@(16));
	}];


    //: 描述_1
    UILabel *pathwayXylophone = [UILabel new];
    pathwayXylophone.frame = CGRectMake(26, 25, 115, 85);
    pathwayXylophone.text = @"label_1";
    pathwayXylophone.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
    pathwayXylophone.textColor = [UIColor colorWithRed:239/255.0 green:99/255.0 blue:229/255.0 alpha:0.8];
    pathwayXylophone.textAlignment = NSTextAlignmentCenter;
    //: 不用理会的骚操作 = pathwayXylophone.numberOfLines = 1;
    NSInteger oasisCharismaUnfold = 1;
    if (oasisCharismaUnfold>10 && oasisCharismaUnfold < 3270) {
	    oasisCharismaUnfold = 33;
	    NSString *elevate = [NSString stringWithFormat:@"%ld", (long)oasisCharismaUnfold];
	    if (elevate.length>54 && [elevate isEqualToString:pathwayXylophone.text]) {
		    oasisCharismaUnfold = elevate.integerValue * 6;
	    }
    }
    pathwayXylophone.numberOfLines = oasisCharismaUnfold;
    self.zealReverieLabel = pathwayXylophone;
    [self.contentView addSubview:pathwayXylophone];

	//: 描述_2
	[self.contentView addSubview:self.balanceLanternHologramView];


    //: 描述_3
    self.onyxBrightenXenophobeView = [UIView new];
    self.onyxBrightenXenophobeView.size = CGSizeMake(84, 193);
    self.onyxBrightenXenophobeView.left = 9;
    self.onyxBrightenXenophobeView.top = 34;
    [self.contentView addSubview:self.onyxBrightenXenophobeView];

	//: 描述_4
	[self.contentView addSubview:self.zestfulButton];
	[self.zestfulButton mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(198);
		make.height.mas_equalTo(30);
	}];


    //: 描述_5
    UIView *balloon = [UIView new];
    self.unwindTranquilView = balloon;
    [self.contentView addSubview:balloon];
	[self.unwindTranquilView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(104);
		make.height.mas_equalTo(61);
		make.top.equalTo(@(21));
		make.bottom.equalTo(@(27));
	}];

	//: 描述_6
	[self.contentView addSubview:self.nirvanaQuestLanternImageView];
	[self.nirvanaQuestLanternImageView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(57);
		make.height.mas_equalTo(165);
		make.top.equalTo(@(13));
	}];


    //: 描述_7
    self.prismMergeInvincibleButton = [[UIButton alloc] initWithFrame:CGRectZero];
    self.prismMergeInvincibleButton.frame = CGRectMake(27, 24, 146, 89);
    UIImage *imagination = [UIImage imageNamed:@"images/icon_7.png"];
    if (imagination) {
	    [self.prismMergeInvincibleButton setImage:imagination forState:UIControlStateNormal];
    }
    [self.prismMergeInvincibleButton setTitle:@"button_7" forState:UIControlStateNormal];
    [self.prismMergeInvincibleButton setTitle:@"button_selected_7" forState:UIControlStateSelected];
    [self.prismMergeInvincibleButton setTitleColor:[UIColor colorWithRed:141/255.0 green:110/255.0 blue:5/255.0 alpha:1.0] forState:UIControlStateNormal];
    [self.prismMergeInvincibleButton setTitleColor:[UIColor colorWithRed:4/255.0 green:254/255.0 blue:226/255.0 alpha:0.7] forState:UIControlStateSelected];
    [self.prismMergeInvincibleButton addTarget:self action:@selector(action_7) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:self.prismMergeInvincibleButton];
}


@end